home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
indus
/
rental
/
amaint.prg
< prev
next >
Wrap
Text File
|
1986-05-30
|
13KB
|
417 lines
** Last revision: April 6, 1986 at 15:54
* amaint.prg accounting maintenance program
STOR .t. TO account1
DO WHIL account1
STOR '?' to command
CLEA
IF clipper
@ 0,0, 22, 79 BOX frame
@ 4,1 SAY line1
@ 19,1 SAY line1
ELSE
@ 0,0 TO 4,79
@ 0,0 TO 19,79
@ 0,0 TO 22,79 DOUBLE
ENDI
@ 20,5 SAY 'Please select one of the above options. You may also leave this menu'
@ 21,5 SAY "by typing 'Q' and get on-line HELP by typing '?'."
@ 2,04 SAY dconame + ' - ACCT MAINTENANCE MENU'
@ 2,65 SAY DTOC(DATE())
@ 7,17 SAY "A. Browse accounting records"
@ 8,17 SAY "B. Close books for the year"
@ 9,17 SAY "C. Edit, change or index Chart of Accounts"
@ 10,17 SAY "D. First initialization of program"
@ 11,17 SAY "E. Change company name or default drive"
@ 12,17 SAY "F. Reindex accounting records"
@ 13,17 SAY "G. Return to main accounting menu"
@ 18,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
@ 18,58 GET command PICTURE '!'
READ
DO WHIL AT(COMMAND, 'ABCDEFGQ?') = 0
STOR '?' TO command
@ 18,58 GET command PICTURE '!'
READ
ENDD
CLEA GETS
DO CASE
CASE command = 'A'
IF .NOT. clipper
CLOS INDEX
GO top
* browse thru records
CLEA
TEXT
***WARNING*** ***WARNING*** ***WARNING***
Changes made will be written to the File
CTRL-C write current record & go down
CTRL-R write current record & go up
CTRL-Z/B pans screen left or right
CTRL-V toggles Insert on or off
CTRL-G Delete character under cursor
CTRL-U Delete or Recall current record
CTRL-Q exit Don't Write Current record
CTRL-W exit and Save all changes
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
BROWSE allows you to change raw accounting data, so please use it with care.
You can examine the record in either ENTRY order or SORT order. The use of
ENTRY order presents both the debit and the credit. You locate a record by
the date of posting. Sort order locates by account number. You have to find
the corresponding debit or credit separately. In either case, if the record
is not found, the program will go to the first record.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ENDT
* get a starting point in file
STOR 'E' TO sttype
@ 22,12 SAY 'Shall we browse by <E)ntry order or <S)ort order'
@ 22,63 Get sttype PICTURE '!'
READ
DO WHIL AT(sttype,'ES')=0
@ 22,12 SAY 'Shall we browse by <E)ntry order or <S)ort order'
@ 22,63 Get sttype PICTURE '!'
READ
ENDD WHILE @(sttype)
IF sttype = 'S'
SET INDEX TO &dr.:account
STOR ' ' TO mstart
@ 22,00
@ 22,12 SAY 'WHAT IS THE STARTING ACCOUNT NUMBER ?'
@ 22,55 GET mstart PICTURE '9999'
READ
SEEK mstart
IF (EOF() .OR. BOF())
GO TOP
ENDI # = 0
ELSE
CLOS INDEX
@ 22,00
STOR ' ' TO mstar
@ 22,10 SAY 'WHAT IS THE STARTING DATE (MM/DD/YY) ? '
@ 22,50 GET mstar PICTURE '99/99/99'
READ
STOR SUBSTR(mstar,7,2) + SUBSTR(mstar,1,2) + SUBSTR(mstar,4,2) TO mstart
LOCA FOR mstart = date
IF EOF()
GO TOP
ENDI EOF
ENDI sttype
* display selected list
CLEA
* browse thru file
SET ESCAPE OFF
BROW fields date, data, amount, posted
SET ESCAPE ON
CLEA
RELE mstar, mstart
SET INDEX TO &dr.:account
ELSE
CLEAR
@ 15,17 SAY 'Function not available in Clipper'
@ 16,17 SAY 'PLEASE HIT ANY KEY TO CONTINUE '
SET CONSOL OFF
WAIT
SET CONSOL ON
ENDI
LOOP
CASE command = 'B'
CLEA
STOR 'N' TO option
TEXT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
W A R N I N G W A R N I N G W A R N I N G
============= ================== ==============
This option is designed to create a new data base file to
start a calendar or fiscal year (or for that matter, to
close out any period. It takes a while to run and if
something happens (like a voltage drop) while it is
running - you could very well lose all of your data.
The old file will be saved as 'AC' + the ending date.
NEVER RUN THIS OPTION UNLESS YOU HAVE BACKED UP YOUR DATA
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ENDT
@ 19,20 SAY 'ARE YOU READY TO PROCEED'
@ 19,47 GET option PICTURE '!'
READ
IF option = 'Y'
SET CONFIRM ON
STOR DTOC(date()) TO myear
CLEA
@ 10,10 SAY "You should be able to stop this program until the last item by"
@ 11,10 SAY "hitting the ESCape key and typing QUIT."
@ 13,10 SAY "I will keep you posted as we go along."
@ 15,10 SAY "What is the last day of the period your are closing ?"
@ 15,68 GET myear PICTURE '99/99/99'
READ
STOR '01/01/' + STR((VAL(SUBSTR(myear,7,2))+1),2) TO nyear
@ 16,10 SAY "What is the first day of the new period you are opening ?"
@ 16,68 GET nyear PICTURE '99/99/99'
READ
STOR 'AC' + SUBSTR(myear,1,2) +SUBSTR(myear,4,2)+SUBSTR(myear,7,2)+'.DBF' TO newname
SET CONFIRM OFF
SET TALK ON
SELE C
USE &dr.:account
INDE on SUBSTR(data,7,4) + SUBSTR(data,5,2) TO &dr.:temp
SET INDEX TO &dr.:temp
COPY STRUCTURE TO &dr.:temp
GO TOP
STOR SUBSTR(data,7,4) + SUBSTR(data,5,2) TO info
STOR 0 TO mamount
STOR 0 TO recno
DO WHIL .NOT. EOF()
DO CASE
CASE SUBSTR(info,1,1)='1'.OR.SUBSTR(info,1,1)='2'.OR.SUBSTR(info,1,2)='57'
IF SUBSTR(data,7,4) + SUBSTR(data,5,2) = info
STOR mamount + amount TO mamount
SKIP
ELSE
STOR RECNO() TO recno
SELE F
USE &dr.:TEMP
IF mamount <> 0
IF mamount > 0
STOR 'D' to type
ELSE
STOR 'C' TO type
ENDI mamount > 0
APPE BLANK
REPL date WITH SUBSTR(nyear,7,2)+SUBSTR(nyear,1,2)+SUBSTR(nyear,4,2)
REPL data WITH 'J001'+ SUBSTR(info,5,2) + SUBSTR(info,1,4) + type+ 'opening entry ' + nyear + 'J'
REPL amount WITH mamount
ENDI mamount <> 0
SELE C
USE &dr.:account
SET index TO &dr.:temp
STOR 0 TO mamount
GO recno
STOR SUBSTR(data,7,4) + SUBSTR(data,5,2) TO info
ENDI $(data,7,4)
OTHE
IF .NOT. EOF()
STOR mamount + amount TO mamount
SKIP
ELSE
SELE F
USE &dr.:TEMP
IF mamount <> 0
IF mamount > 0
STOR 'D' to type
ELSE
STOR 'C' TO type
ENDI mamount > 0
APPE BLANK
REPL date WITH SUBSTR(nyear,7,2)+SUBSTR(nyear,1,2)+SUBSTR(nyear,4,2)
REPL data WITH 'J001992530' + type+ 'opening entry ' + nyear + 'J'
REPL amount WITH mamount
ENDI mamount <> 0
SELE C
USE &dr.:account
SET index TO &dr.:temp
ENDI .NOT. EOF
ENDC
ENDD WHILE .NOT. EOF
DO CASE
CASE SUBSTR(info,1,1)='1'.OR.SUBSTR(info,1,1)='2'.OR.SUBSTR(info,1,2)='57'
SELE F
USE &dr.:TEMP
IF mamount <> 0
IF mamount > 0
STOR 'D' to type
ELSE
STOR 'C' TO type
ENDI mamount > 0
APPE BLANK
REPL date WITH SUBSTR(nyear,7,2)+SUBSTR(nyear,1,2)+SUBSTR(nyear,4,2)
REPL data WITH 'J001'+ SUBSTR(info,5,2) + SUBSTR(info,1,4) + type+ 'opening entry ' + nyear + 'J'
REPL amount WITH mamount
ENDI mamount <> 0
OTHE
SELE F
USE &dr.:TEMP
IF mamount <> 0
IF mamount > 0
STOR 'D' to type
ELSE
STOR 'C' TO type
ENDI mamount > 0
APPE BLANK
REPL date WITH SUBSTR(nyear,7,2)+SUBSTR(nyear,1,2)+SUBSTR(nyear,4,2)
REPL data WITH 'J001992530' + type+ 'opening entry ' + nyear + 'J'
REPL amount WITH mamount
ENDI mamount <> 0
ENDC
SELE C
USE &dr.:account
SET index TO &dr.:temp
SAVE TO temp
CLEA ALL
REST FROM